//
//  UIViewController+Visible.m
//  iOS-Categories (https://github.com/shaojiankui/iOS-Categories)
//
//  Created by Jakey on 14/12/15.
//  Copyright (c) 2014年 www.skyfox.org. All rights reserved.
//

#import "UIViewController+Visible.h"
//#import "BaseTationViewController.h"

@implementation UIViewController (Visible)
- (BOOL)isVisible {
    return [self isViewLoaded] && self.view.window;
}


- (BOOL)shouldAutorotate
{
    
//    if([self isKindOfClass:[UINavigationController class]]){
//        UINavigationController *bac =(UINavigationController *)self;
//        
//        if([[bac.topViewController class] isSubclassOfClass:[BaseTationViewController class]]){
//            
//            return YES;
//            
//        }
//        
//    }
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    
//    if([self isKindOfClass:[UINavigationController class]]){
//        UINavigationController *bac =(UINavigationController *)self;
//        // NSLog(@"--%@----%@",[bac.topViewController class],[bac.visibleViewController class]);
//        if([[bac.topViewController class] isSubclassOfClass:[BaseTationViewController class]]){
//            
//            return UIInterfaceOrientationLandscapeRight;
//            
//        }
//        
//    }
    //  NSLog(@"2--%@",[self class]);
    
    return UIInterfaceOrientationMaskPortrait;
}

@end
